import React,{useState,useCallback} from 'react'
import Child from '@/views/Child'
export default function App() {
  console.log('------App redner-------');
  const [count,setCount]=useState(0)
  const [pcount,setPcount]=useState(10)
  let sayHello=()=>{}
  let sayHelloUseCallback=useCallback(sayHello,[])
  return (
    <div>
      <div>父组件</div>
      <div>{count}</div>
      <button onClick={()=>setCount(count+1)}>父组件更新</button>
      <button onClick={()=>setPcount(pcount+1)}>更改来自父组件的数据</button>
      <hr />
      <Child pcount={pcount} callback={sayHelloUseCallback}></Child>
    </div>
  )
}
